diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-02-11 17:56:27 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-02-11 17:56:27 +0100 |
| commit | 8647197a05490e2c10106a021cf6760bdabb5b2a (patch) | |
| tree | 5fb56fad1c0f585ac063a8f6390e68586e3e6084 /src/pages/projet/[slug].tsx | |
| parent | c69c107de84aa3b2cdbf0ed087d0314f22d30b18 (diff) | |
chore: improve accessibility
Diffstat (limited to 'src/pages/projet/[slug].tsx')
| -rw-r--r-- | src/pages/projet/[slug].tsx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/pages/projet/[slug].tsx b/src/pages/projet/[slug].tsx index f96da0e..f72063a 100644 --- a/src/pages/projet/[slug].tsx +++ b/src/pages/projet/[slug].tsx @@ -22,6 +22,7 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import { ParsedUrlQuery } from 'querystring'; import { ComponentType } from 'react'; +import { useIntl } from 'react-intl'; import { Article, Graph, WebPage } from 'schema-dts'; const Project: NextPageWithLayout<ProjectProps> = ({ @@ -29,6 +30,7 @@ const Project: NextPageWithLayout<ProjectProps> = ({ }: { project: ProjectData; }) => { + const intl = useIntl(); const router = useRouter(); const projectUrl = `${settings.url}${router.asPath}`; const { id, intro, meta, title, seo } = project; @@ -107,14 +109,26 @@ const Project: NextPageWithLayout<ProjectProps> = ({ className={`${styles.article} ${styles['article--no-comments']}`} > <PostHeader title={title} intro={intro} meta={{ dates }} /> - <Sidebar position="left"> + <Sidebar + position="left" + ariaLabel={intl.formatMessage({ + defaultMessage: 'Table of Contents', + description: 'ProjectPage: ToC sidebar aria-label', + })} + > <ToC /> </Sidebar> <div className={styles.body}> <ProjectSummary id={id} title={title} meta={meta} /> <ProjectContent components={components} /> </div> - <Sidebar position="right"> + <Sidebar + position="right" + ariaLabel={intl.formatMessage({ + defaultMessage: 'Sidebar', + description: 'ProjectPage: right sidebar aria-label', + })} + > <Sharing title={title} excerpt={intro} /> </Sidebar> </article> |
